/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package warehouse.sorts;

import entity.Warehouse;
import java.util.Comparator;

/**
 *
 * @author Tkach Andrii
 */
public class SortByShipmentRate implements Comparator<Warehouse> {

    @Override
    public int compare(Warehouse wh1, Warehouse wh2) {
        long o1 = wh1.getShipmentRate();
        long o2 = wh2.getShipmentRate();
      
        return  Long.compare(o1, o2);
                //(o1 > o2 ? -1 : (o1 == o2 ? 0 : 1));
    }
}
